<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.model.PostCheck"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="com.shsh.safemanage.model.PostcheckDailyReportItem"%>
<%@page import="com.shsh.safemanage.dao.PostCheckDao"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.action.PostcheckReportAction"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%
{
	Long postcheckID=0l;
	Long userID = 0l;
	Integer year = 0;
	Integer month = 0;
	Integer day = 0;
	
	try{
		postcheckID = Long.parseLong(request.getParameter(Constants.REQUEST_PARAMETER_POSTCHECK_ID));
	} catch (Exception e){
		
	}
	
	PostCheckDao postcheckDao = DaoCreator.createPostCheckDao();
	PostCheck postcheck = postcheckDao.getPostCheck(postcheckID);
	
	try{
		userID = Long.parseLong(request.getParameter(Constants.REQUEST_PARAMETER_USER_ID));
	}catch(Exception e){
		
	}
	
	try{
		year = Integer.parseInt(request.getParameter(Constants.REQUEST_PARAMETER_YEAR));
	}catch(Exception e){
		
	}
	
	
	try{
		month = Integer.parseInt(request.getParameter(Constants.REQUEST_PARAMETER_MONTH));
	}catch(Exception e){
		
	}
	
	
	try{
		day = Integer.parseInt(request.getParameter(Constants.REQUEST_PARAMETER_DAY));
	}catch(Exception e){
		
	}
	
	DepartmentDao departmentDao = DaoCreator.createDepartmentDao();
	Department1 depart1 = departmentDao.getDepart1ByUserID(userID);
	
	
	List<PostcheckDailyReportItem> report = (List<PostcheckDailyReportItem>)request.getAttribute(Constants.REQUEST_ATTRIBUTE_POSTCHECK_USER_DAILY_REPORT);
	if(report == null){
		PostcheckReportAction reportAction = ActionCreator.createPostcheckReportAction();
		boolean isSuccess = reportAction.generatePostcheckUserDailyReport(request);
		report = (List<PostcheckDailyReportItem>)request.getAttribute(Constants.REQUEST_ATTRIBUTE_POSTCHECK_USER_DAILY_REPORT);
	}
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：上海高桥分公司问题管理平台 &gt;&gt;<%=postcheck.getCheckName() %>岗检 &gt;&gt;<%=day==0?"周":"日" %>管理检查情况一览表
</div>
<div class="tt"><%=day==0?"周":"日" %>管理检查情况一览表</div>
<div class="content">
<span>
	<%=depart1.getDepartmentType()==Constants.DEPARTMENT_TYPE_SHIYEBU?"作业部（业务中心）":"处室" %>-<%=depart1.getDepartmentName() %>(<%=year %>-<%=month %>-<%=day %>)
</span>
<table border="1" width="100%" style="align:center;">
	<tr>
		<td>
			序号
		</td>
		<td>
			检查方式
		</td>		
		<td>
			工作内容
		</td>		
		<td>
			工作标准与要求
		</td>		
		<td>
			工作标准来源
		</td>		
		<td>
			扣分标准
		</td>		
		<td>
			检查频次
		</td>		
		<td>
			检查内容记录
		</td>		
		<td>
			考核意见与整改建议
		</td>		
		<td>
			检查单位
		</td>		
		<td>
			检查人
		</td>		
		<td>
			被查单位
		</td>		
		<td>
			装置
		</td>		
		<td>
			要求整改日期
		</td>		
		<td>
			整改完成日期
		</td>		
		<td>
			填报时间
		</td>		
		<td>
			确认人
		</td>		
		<td>
			查看
		</td>				
	</tr>
	<%
	for(int counter = 0 ; counter<report.size(); counter ++ ) {
		PostcheckDailyReportItem item = report.get(counter);
		String closeTimeStr = Util.formatDate(item.getProblem().getCloseTime());
		if(Util.isNullOrEmpty(closeTimeStr)) {
			closeTimeStr = "&nbsp;";
		}
		String closeUserName = item.getProblem().getCloseUserName();
		if(Util.isNullOrEmpty(closeUserName)){
			closeUserName = "&nbsp;";
		}
	%>
	<tr>
		<td>
			<%=counter+1 %>
		</td>
		<td>
			<%=item.getPattern().getPattern() %>
		</td>
		<td>
			<%=item.getContent().getContent() %>
		</td>
		<td>
			<%=item.getStandard().getStandard() %>
		</td>
		<td>
			<%=Util.toString(item.getStandard().getSourceNames(), "<br/>", "")  %>
		</td>
		<td>
			<%=item.getStandard().getGradeStandard() %>
		</td>
		<td>
			<%=item.getStandard().getCheckFrequency() %>
		</td>
		<td>
			<%=item.getProblem().getProblemContent() %>
		</td>
		<td>
			<%=item.getProblem().getProblemZhenggai() %>
		</td>
		<td>
			<%=item.getWriteUserDepart1Name() %>
		</td>
		<td>
			<%=item.getProblem().getWriteUserName() %>
		</td>
		<td>
			<%=item.getProblem().getDepartment1Name() %>
		</td>
		<td>
			<%=item.getProblem().getEquipmentName() %>
		</td>
		<td>
			<%=Util.formatDate(item.getProblem().getCompleteDate()) %>
		</td>
		<td>
			<%=closeTimeStr %>
		</td>
		<td>
			<%=Util.formatDate(item.getProblem().getWriteTime()) %>
		</td>
		<td>
			<%=closeUserName %>
		</td>
		<td>
			<a href="javascript:" onclick="openProblemDetail(<%=item.getProblem().getId() %>)">[详细内容]</a>
		</td>
	</tr>
	<%
	}
	%>
</table>
</div>
<script type="text/javascript">
function openProblemDetail(problemID) {
	loadPageSection('<%=request.getContextPath()%>/problem_feedback.jsp', 'mainContentDiv', {id: problemID}, true);
}
</script>
<%
}
%>